function validateRegistrationForm(form) {

	var name = form['imieId'].value;
	var lastName = form['nazwiskoId'].value;
	var tel = form['telId'].value;
	var pesel = form['peselId'].value;
	var password = form['passwordId'].value;

	var nameRegex = new RegExp('[A-Za-z]{2,64}');
	var lastNameRegex = new RegExp('[A-Za-z]{3,64}');
	var telRegex = new RegExp('[0-9]{9}');
	var peselRegex = new RegExp('[0-9]{11}');
	var passwordRegex = new RegExp('[A-Za-z0-9]{8,32}');

	if (name == null || nameRegex.test(name) == false) {
		alert("Niepoprawne imię!");
		return false;
	}
	if (lastName == null || lastNameRegex.test(lastName) == false) {
		alert("Niepoprawne nazwisko!");
		return false;
	}
	if (tel == null || telRegex.test(tel) == false) {
		alert("Niepoprawny numer telefonu!");
		return false;
	}
	if (pesel == null || peselRegex.test(pesel) == false) {
		alert("Niepoprawne nr pesel!");
		return false;
	}
	if (password == null || passwordRegex.test(password) == false) {
		alert("Niepoprawne format hasła!");
		return false;
	}
	return true;
}